home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Forward task -- Reverse forward *)
- (* *)
- (* Copyright 1988, 1989 by H. Roy Engehausen. All rights reserved. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* Forward rev... See if other end has any mail for me *)
- (*===========================================================================*)
-
- PROCEDURE forward_rev(path_common : path_block_ptr);
-
- VAR
- i : WORD;
- t_str : STRING;
-
- BEGIN;
-
- (*-----------------------------------------------------------------------*)
- (* Ensure that the error switch is off and reverse forward is on *)
- (*-----------------------------------------------------------------------*)
-
- active_tcb^.error_sw := FALSE;
- active_tcb^.tcb_rev_fwd := TRUE;
-
- (*-----------------------------------------------------------------------*)
- (* Loop forever -- There is no exit from this block *)
- (*-----------------------------------------------------------------------*)
-
- WHILE TRUE DO
- BEGIN;
-
- (*-------------------------------------------------------------------*)
- (* Send the prompt *)
- (*-------------------------------------------------------------------*)
-
- send_tnc_data_str('F>' + cr);
-
- (*-------------------------------------------------------------------*)
- (* Read the reply *)
- (*-------------------------------------------------------------------*)
-
- t_str := upcase_str(read_tnc_data_str);
- strip_crlf(t_str);
-
- (*-------------------------------------------------------------------*)
- (* If it ain't a send command, dump the session *)
- (*-------------------------------------------------------------------*)
-
- IF (LENGTH(t_str) < 3) OR (words(t_str) = 0) OR (t_str[1] <> 'S')
- OR ((t_str[2] <> ' ') AND (t_str[3] <> ' ')) THEN
- BEGIN;
- path_common^.path_delay := FALSE;
- end_session(TRUE);
- END;
-
- (*-------------------------------------------------------------------*)
- (* Handle send command *)
- (*-------------------------------------------------------------------*)
-
- send_msg_cmd(t_str);
- active_tcb^.tcb_rcv_msg := FALSE;
-
- (*-------------------------------------------------------------------*)
- (* If an error, dump the session. *)
- (*-------------------------------------------------------------------*)
-
- IF active_tcb^.error_sw THEN
- BEGIN;
- path_common^.path_delay := FALSE;
- end_session(TRUE);
- END;
-
- END; (*----- End reverse forwarding loop ------------------------------*)
-
- END;